#include "view_time_17.h"
#include "view_time_17.inc"
#include "view_time_14.h"
#include "view_time_3.h"
#include "view_time_0.h"
#include "display_ctrl.h"
#include "platform_assert.h"
#include "lfs_file_manager_auto.h"
#include "rtc.h"
#include "datetime.h"
#include "blecom.h"
#include "battery_ctrl.h"
#include "sport_his.h"
#include "display_ctrl.h"
#include "display_interface_240x240.h"
#include "datetime.h"
#include "heart_rate_interface.h"
#include "font/num_font.h"
#include "font_mngr.h"
#include "view_common.h"
#include "app_trace.h"
#include "view_times.h"
#include "math.h"
#include "weather_ctrl.h"
#include "health_storage.h"
#include "app_trace.h"
#include "view_time_10.h"
#include "view_time_8.h"
#define LOG(fmt, ...) app_trace_log(fmt "\r\n", ##__VA_ARGS__)
#ifdef TIME_17_SKIP
#else
void view_time_17_display(void)
{
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 0, 0, FILE_IMG_back_1);
    show_time_0_battery(disp_ctrl.com_data.i_temp[7], disp_ctrl.com_data.i_temp[8]);
    show_time_0_ble();

#if 0
#warning debug
    disp_ctrl.com_data.f_temp[26] = 37.4F;
    disp_ctrl.com_data.f_temp[25] = 137.4F;
    disp_ctrl.com_data.i_temp[17] = 132;
#else

#endif
    int const heart_rate_num_width = 14;
    int const heart_rate_num_height = 16;
    int const heart_rate_num_interval = 1;
    int const heart_rate_start_x = 29;
    int heart_rate_draw_x = heart_rate_start_x;
    int const heart_rate_draw_y = 211;
    if (disp_ctrl.com_data.i_temp[17] < 40 || disp_ctrl.com_data.i_temp[17] > 220)
    {
        disp_draw_rect_color(heart_rate_draw_x, heart_rate_draw_y + heart_rate_num_height / 2 - 3, heart_rate_draw_x + heart_rate_num_width - 1, heart_rate_draw_y + heart_rate_num_height / 2 - 1,
                             RGB565_COLOR_WHITE);
        heart_rate_draw_x += heart_rate_num_width + heart_rate_num_interval;
        disp_draw_rect_color(heart_rate_draw_x, heart_rate_draw_y + heart_rate_num_height / 2 - 3, heart_rate_draw_x + heart_rate_num_width - 1, heart_rate_draw_y + heart_rate_num_height / 2 - 1,
                             RGB565_COLOR_WHITE);
    }
    else
    {
        disp_draw_user_image_num_filter_color(heart_rate_draw_x, heart_rate_draw_y, disp_ctrl.com_data.i_temp[17], heart_rate_num_width + heart_rate_num_interval, num_14x16_TAB);
    }

    disp_draw_user_image_num_with_digits_filter_color(2, 165, disp_ctrl.com_data.i_temp[3], 2, 26, num_24x30_TAB);

    disp_draw_user_image_num_with_digits_filter_color(60, 165, disp_ctrl.com_data.i_temp[4], 2, 26, num_24x30_TAB);

    view_time_show_temperature_float_with_font(146, 173, disp_ctrl.com_data.f_temp[26], disp_ctrl.com_data.i_temp[21] == WEATHER_TEMPERATURE_TYPE_C, false, num_14x16_TAB, 0, 1, 1);
    view_time_show_temperature_float_with_font(146, 211, disp_ctrl.com_data.f_temp[25], disp_ctrl.com_data.i_temp[21] == WEATHER_TEMPERATURE_TYPE_C, false, num_14x16_TAB, 0, 1, 1);
}
#endif
